package util
{
	/**
	 * 辅助类
	 */ 
	public class Util
	{
		/**
		 * 截取开头，结尾的空白字符
		 */ 
		static	public	function	trim(str:String):String{
			//截取开头空白字符
			var ch:String;
			var start:int = 0;
			for(var i:int = 0; i < str.length; i++){
				ch = str.charAt(i);
				if (ch != " "){
					start = i;
					break;
				}
		
			}
			str = str.substr(start, str.length-start);
			
			start = str.length -1;
			for(i = str.length-1; i >=0; i--){
				ch = str.charAt(i);
				if (ch != " "){
					start = i;
					break;
				}
			}
			
			str = str.substr(0, start+1);
			return str;
		}
	}
}